<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <p>1</p>
  <p>2</p>
  <p>3</p>
  <script>
    const [p1, p2, p3] = document.querySelectorAll('p')
    const m = new Map([
      [p1,{
        color:'green',
        backgroundColor:'pink',
        fontSize:'40px'
      }],
      [p2, {
        color:'green',
        backgroundColor:'pink',
        fontSize:'40px'
      }],
      [p3, {
        color:'green',
        backgroundColor:'pink',
        fontSize:'40px' 
      }]
    ])
    m.forEach((propObj, elem) =>{
      for(const p in propObj){
        elem.style[p]=propObj[p]
      }
    })
  </script>

</body>

</html>